package com.googlecode.flex_solder.util  {
  /**
   * $Id: FileUtil.as 29 2009-05-30 13:12:19Z fuller.sethm $
   * 
   */


  import flash.filesystem.File;

  public class FileUtil {

    public function FileUtil() {

    }

    /** 
     * isNewer - This function returns true if file1 is newer than file2
     * 
     * @param File file1
     * @param File file2
     * 
     * @return true - if file1 is newer than file2
     */
    public static function isNewer(file1:File, file2:File):Boolean {
      var fileIsNewer:Boolean = false;
      if (null != file1 && null != file2 && file2.exists) {
	if (!file1.exists
	    || file1.modificationDate.time > file2.modificationDate.time) {
	  fileIsNewer = true;
	}
      }

      return fileIsNewer;
    }

    public function toString():String {
      return "FileUtil()";
    }
  }
}